package com.ruoyi.common.cmb.enums;

/**
 * 招商银行的方法枚举类
 */
public enum CMBTransAction {
    //企银支付单笔经办
    ProxyPay("企银支付单笔经办","BB1PAYOP" ),
    DCLISMOD("可经办业务模式查询","DCLISMOD" ),
    BB1PAYQR("企银支付业务查询","BB1PAYQR" );
    // 支付申请类型名称
    private String name;

    // 支付申请类型编码
    private String code;

    CMBTransAction(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public static CMBTransAction getTransType(String code) throws RuntimeException {
        for (CMBTransAction type : CMBTransAction.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new RuntimeException("系统异常！未知银行接口码[" + code + "]");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
